package com.woniu.user.controller;


import com.woniu.entity.Result;
import com.woniu.user.pojo.Fans;
import com.woniu.user.service.IFansService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 关注和粉丝表 前端控制器
 * </p>
 *
 * @author LiFangyu
 * @since 2023-02-15
 */
@RestController
@RequestMapping("/fans")
public class FansController {
    @Autowired
    IFansService fansService;

    @ApiOperation("关注用户")
    @GetMapping("/attentionByUser/{userPhone}/{userToPhone}")
    public Result attentionByUser(@PathVariable("userPhone") String userPhone,@PathVariable("userToPhone") String userToPhone){
        return fansService.attentionByUser(userPhone,userToPhone);
    }


    @ApiOperation("取消关注用户")
    @GetMapping("/rmAttentionByUser/{userPhone}/{userToPhone}")
    public Result rmAttentionByUser(@PathVariable("userPhone") String userPhone,@PathVariable("userToPhone") String userToPhone){
        return fansService.rmAttentionByUser(userPhone,userToPhone);
    }

}
